﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;

namespace eLoan.Models
{
    public class CollectionReportModel
    {
        [Display(Name = "Select a branch")]
        public IEnumerable<SelectListItem> Branches { get; set; }

        public string SelectedBranchCode { get; set; }

        [Display(Name = "Select an agent")]
        public IEnumerable<SelectListItem> Agents { get; set; }

        public int SelectedAgentID { get; set; }

        public bool IsAgentSelected { get; set; }

        [Display(Name = "Select a payment type")]
        public IEnumerable<SelectListItem> PaymentTypes { get; set; }

        public int SelectedPaymentTypeID { get; set; }

        [Display(Name = "From")]
        [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:MM/dd/yyyy}")]
        public DateTime FromDate { get; set; }

        [Display(Name = "To")]
        [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:MM/dd/yyyy}")]
        public DateTime ToDate { get; set; }

        [Display(Name = "Date")]
        [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:MM/dd/yyyy}")]
        public DateTime Date { get; set; }

        public List<CollectionReportItem> CollectionReportItems { get; set; }

        public decimal TotalPenalty { get; set; }

        public decimal TotalPayment { get; set; }

        public decimal TotalCollection { get; set; }

        [Display(Name = "Date Range")]
        public bool IsRangeReport { get; set; }

        [Display(Name = "Daily")]
        public bool IsDailyReport { get; set; }
    }

    public class CollectionReportItem
    {
        [Display(Name = "Document No")]
        public string DocumentNo { get; set; }

        [Display(Name = "Borrower")]
        public string BorrowerName { get; set; }

        [Display(Name = "Agent ID")]
        public int AgentID { get; set; }

        [Display(Name = "Agent")]
        public string AgentName { get; set; }

        [Display(Name = "Payment Type")]
        public string PaymentTypeName { get; set; }

        [Display(Name = "Interest Rate")]
        public decimal InterestRate { get; set; }

        [Display(Name = "Loan Amount")]
        public decimal LoanAmount { get; set; }

        [Display(Name = "Posted Payment")]
        public decimal PostedPayment { get; set; }

        [Display(Name = "Penalty")]
        public decimal Penalty { get; set; }

    }

}